1. Field of the Invention
The present invention relates to an image correction apparatus for a stereo camera which corrects an optical positional deviations in images taken by the stereo camera.
2. Description of the Related Art:
Image processing according to what is called a stereo method is known as a three-dimensional measuring technique using images. In this technique, in general, correlation between a pair of images obtained by imaging an object by two cameras (stereo camera) from different positions is determined and the distance is determined based on a parallax of the same object according to the principle of triangulation by using camera parameters such as installation positions and a focal length of the stereo camera.
In this image processing according to the stereo method, a position where two image signals that are output from the stereo camera coincide with each other by superimposing the two image signals while shifting those sequentially. Therefore, essentially, it is desirable that there exist, between the two images, only deviations between corresponding positions as caused by a parallax; if there exist positional deviations due to other optical distortions etc., mismatching occurs and the accuracy of distance information is lowered.
For the above reason, adjustments of optical positions are extremely important in using a stereo camera. Japanese Unexamined Patent Publication No. Hei. 5-157557 discloses a technique of mechanically adjusting and holding correlation between two video cameras by providing, on a holding member for connecting and holding the two video cameras, a parallelism adjusting means for making adjustments so that the pixel array of an image sensor of one video camera becomes parallel with that of an image sensor of the other video camera and an optical axis adjusting member for making adjustments so that the optical axis of one video camera becomes parallel with that of the other video camera.
However, conventionally, once deviations due to deterioration with age occur in a fixed stereo camera, readjustments should be performed in terms of mechanical structure. Readjustments not only require cumbersome operations but also take long time. Further, mechanical adjustments can assure only a limited degree of accuracy.
To cope with the above problems, the present applicant has proposed, in Japanese Patent Application No. Hei. 9-117268, a technique of making adjustments electrically rather than mechanically by affine-transforming images in accordance with deviations in optical positions of a stereo camera. This techniques makes it possible to adjust optical positions of the stereo camera precisely to such a level as is difficult to attain by mechanical adjustments, and to easily perform readjustments on deviations due to deterioration with age after original adjustments.
However, the correction technique by affine-transforming images that has been proposed by the present applicant is linear corrections, such as optical position corrections in the horizontal and vertical directions and the rotational direction and a correction of a variation in the focal length (angle of view) of a lens, that act uniformly on the entire image. Therefore, this correction technique cannot deal with nonlinear distortions in an image due to influence of a lens distortion, differences in enlargement and reduction factors that depend on the region in an image as caused by inclination of the photodetecting surface of an imaging device, and other factors.
Further, in a stereo camera, there may occur a case that to orient a distance information generation region to an optimum direction in accordance with use, a main camera for taking a reference image for stereo processing and a sub-camera for taking a comparison image for the stereo processing are mounted in advance so as to be inclined from the base line of the stereo camera. For example, in a vehicular stereo camera, there may occur a case that to locate a distance detection region evenly in the right-left direction with respect to the visual field in the right-left direction, the main camera and the sub-camera are so mounted as to be directed rightward with respect to the front side of the camera system (i.e., the front side of the self vehicle) and a sub-camera-side region, accounting for a prescribed proportion, of an image taken by the main camera is employed as a distance information generation region.
Such inclined mounting of the two cameras with respect to the base line of the stereo camera requires nonlinear shape corrections on images taken. Corrections of nonlinear positional deviations in images including distortions of the above kinds due to a lens distortion, inclination of the photodetecting surface of an imaging device, etc. are an issue that remains to be addressed.
The present invention has been made in view of the above circumstances, and an object of the invention is therefore to provide an image correction apparatus for a stereo camera which can improve the reliability of stereo processing by making it possible to correct, in an on-board state, nonlinear positional deviations among optical positional deviations in images taken by the stereo camera.
The above-described object of the invention can be attained by an image correction apparatus for a stereo camera which corrects optical positional deviations in images taken by the stereo camera, comprising means for performing interpolation on mutual referencing positions in stereo matching of a pair of images taken by the stereo camera by using pixel-by-pixel positional deviations that have been determined in advance and coordinate data around the referencing positions.
That is, in the invention, interpolation is performed on referencing positions in the counterpart image in stereo matching of a pair of images taken by the stereo camera by using pixel-by-pixel positional deviations that have been determined in advance and coordinate data around the referencing positions, and matching is made by referring to interpolated coordinates, whereby mismatching between corresponding positions can be prevented.